<!DOCTYPE HTML>
<html>

<head>
    <title> 详情页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../../../assets/css/dpl-min.css" rel="stylesheet" type="text/css"/>
    <link href="../../../assets/css/bui-min.css" rel="stylesheet" type="text/css" />
    <link href="../../../assets/css/page-min.css" rel="stylesheet" type="text/css" />
    <link href="../../../assets/css/jx-style.css" rel="stylesheet" type="text/css"/>
    <link href="../../../assets/css/prettify.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div class="container">
        <div class="detail-page">
            <h3>供应商列表<button type="button" id="add-supplier-btn" class="pull-right button button-default">添加供应商</button></h3>
            <hr>
            <div class="detail-section">
                <div class="detail-row">
                    <form id="J_Form" class="form-horizontal well">
                        <div class="row ">
                            <div class="control-group span8">
                                <label class="control-label">供应商登录帐号:</label>
                                <div class="controls">
                                    <input name="" type="text" class="control-text">
                                </div>
                            </div>
                            <div class="control-group span8">
                                <label class="control-label">供货商名称:</label>
                                <div class="controls">
                                    <input name="sid" type="text" class="control-text">
                                </div>
                            </div>
                            <div class="control-group span12">
                                <label class="control-label"> 发货地：</label>
                                <div class="controls bui-form-group-select" data-type="city">
                                    <select class="input-small">
                                        <option>省份</option>
                                    </select>&nbsp;&nbsp;省&nbsp;&nbsp;
                                    <select class="input-small">
                                        <option>城市</option>
                                    </select>&nbsp;&nbsp;市&nbsp;&nbsp;
                                    <select class="input-small">
                                        <option>区</option>
                                    </select>&nbsp;&nbsp;区&nbsp;&nbsp;
                                </div>
                            </div>
                            <div class="control-group span2 pull-right">
                                <button type="submit" class="button  jx-button">搜索</button>
                            </div>
                        </div>
                    </form>
                    <!-- 表格 start-->
                    <div id="grid"></div>
                    <!-- 表格 end-->
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../../../assets/js/jquery-1.8.1.min.js"></script>
    <script type="text/javascript" src="../../../assets/js/bui-min.js"></script>
    <script type="text/javascript" src="../../../assets/js/config-min.js"></script>
    <script type="text/javascript">
    BUI.use('common/page');
    </script>
    <!-- script start -->
    <script type="text/javascript">
    BUI.use(['bui/grid', 'bui/data', 'common/search', 'bui/form'], function(Grid, Data, Search, Form) {
        var Grid = Grid,
            Store = Data.Store,
            columns = [{
                title: '供应商ID',
                dataIndex: 'a',
                elCls: 'center', //居中
                width: 100
            }, {
                title: '供应商登录账号 ',
                elCls: 'center',
                dataIndex: 'b',
                width: 100
            }, {
                title: '供应商名称',
                elCls: 'center',
                dataIndex: 'c',
                width: 100
            }, {
                title: '发货地',
                elCls: 'center',
                dataIndex: 'd',
                width: 300
            }, {
                title: '发货仓简称',
                elCls: 'center',
                dataIndex: 'e',
                width: 100
            }, {
                title: '库存管理方式',
                elCls: 'center',
                dataIndex: 'f',
                width: 100
            }, {
                title: '激想仓库编码',
                elCls: 'center',
                dataIndex: 'g',
                width: 100
            }, {
                title: '启用状态',
                elCls: 'center',
                dataIndex: 'h',
                width: 100
            }, {
                title: '操作',
                dataIndex: 'i',
                elCls: 'center',
                width: 200,
                renderer: function(value, obj) {
                    var editStr = Search.createLink({ //链接使用 此方式
                        id: 'edit' + obj.id,
                        title: '编辑供应商',
                        text: '[ 编辑 ] ',
                        href: 'templates/supplier/supplier-list/add-supplier.html'
                    });
                    return editStr;
                }
            }],
            data = [{
                id: '1222',
                a: 'JX0001',
                b: '15900684377',
                c: '激想',
                d: '上海上海市浦东新区金藏路257号33幢东侧201室',
                e: '上海仓',
                f: '激想维护',
                g: '17',
                h: '正常'
            }, {
                id: '1222',
                a: 'JX0001',
                b: '15900684377',
                c: '激想',
                d: '上海上海市浦东新区金藏路257号33幢东侧201室',
                e: '上海仓',
                f: '激想维护',
                g: '17',
                h: '正常'
            }, {
                id: '1222',
                a: 'JX0001',
                b: '15900684377',
                c: '激想',
                d: '上海上海市浦东新区金藏路257号33幢东侧201室',
                e: '上海仓',
                f: '激想维护',
                g: '17',
                h: '正常'
            }];
        //初始化数据
        var isAddRemote = false,
            editing = new Grid.Plugins.DialogEditing({
                contentId: 'content', //设置隐藏的Dialog内容
                triggerCls: 'btn-edit', //触发显示Dialog的样式
                editor: {
                    title: '编辑商品品牌',
                    width: 600,
                }
            }),
            store = new Store({ //初始化数据
                data: data,
                autoLoad: true, //自动加载数据
                pageSize: 2 // 配置分页数目
            }),
            grid = new Grid.Grid({
                render: '#grid',
                elCls: 'small-bui-grid-table',
                columns: columns,
                loadMask: true, //加载数据时显示屏蔽层
                forceFit: true,

                // 底部工具栏
                bbar: {
                    // pagingBar:表明包含分页栏
                    pagingBar: true
                },
                plugins: [editing], //插件
                store: store
            }),
            form = new Form.Form({
                srcNode: '#J_Form'
            });
        form.render();

        grid.render();

    });
    $("#add-supplier-btn").click(function() {
            top.topManager.openPage({
                id: 'add-supplier',
                href: 'templates/supplier/supplier-list/add-supplier.html',
                title: '添加供应商'
            });
        });
    </script>
    <!-- script end -->

    <body>

</html>
